'use strict';

angular.module('snPaas_om')
	.controller('VersionsCtrl',['$scope','baseUrl','ngDialog','versionStore',function($scope,baseUrl,ngDialog,versionStore){
		var vm = $scope;
		vm.baseUrl = baseUrl.static;
		vm.addVersion = function(){
			ngDialog.open({
				template: baseUrl.static+'template/views/newVersion.html',
				controller: 'NewVersionCtrl',
				width: 510
			});
		};
		vm.init = function(){
			versionStore.getList(1).then(function(data){
				vm.versionList = data;
			});
		};
		vm.init();

	}]);